/*
 * Copyright 2014 Graham Smith
 */
package uk.co.wobblycogs.vegas.project;

import java.io.Serializable;
import java.nio.file.Path;
import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import uk.co.wobblycogs.vegas.PathConverter;

/**
 *
 * @author Graham Smith
 */
@Entity
@NamedQueries({
	@NamedQuery(name = Project.FIND_ALL, query = "SELECT p FROM Project p"),
	@NamedQuery(name = Project.FIND_BY_PATH, query = "SELECT p FROM Project p WHERE p.projectPath= :projectPath")
})
public class Project implements Serializable {

	public static final String FIND_ALL = "uk.co.wobblycogs.vegas.project.Project.findAll";
	public static final String FIND_BY_PATH = "uk.co.wobblycogs.vegas.project.Project.findByPath";

	@Id
	@GeneratedValue
	private int id;
	@Column(unique = true)
	private Path projectPath;

	public Project() {
	}

	public Project(Path projectPath) {
		this.projectPath = projectPath;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Path getProjectPath() {
		return projectPath;
	}

	public void setProjectPath(Path projectPath) {
		this.projectPath = projectPath;
	}

}
